#!/usr/bin/env bash
url=`grep -o 'https://.*_linux_amd64.zip' /tmp/downloads.html`
filename=`grep -o 'vagrant_.*linux_amd64.zip' /tmp/downloads.html`
cd /tmp
# only download if we need to
if [ ! -f $filename ];
then
  wget $url
fi
cd /usr/local/bin
unzip /tmp/${filename}
rm /tmp/${filename} /tmp/downloads.html
chmod 755 /usr/local/bin/vagrant
